<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
//行驶证
class CreateRecognizeDrivingLicensesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recognize_driving_licenses', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('car_id')->default(0)->comment('车辆id');
            $table->text('images')->nullable()->comment('行驶证照片');
            $table->string('vin')->nullable()->comment('车架号');
            $table->string('plate_number')->nullable()->comment('车牌号');
            $table->string('owner')->nullable()->comment('车主');
            $table->string('engine_number')->nullable()->comment('引擎号');
            $table->string('address')->nullable()->comment('地址');
            $table->string('vehicle_type')->nullable()->comment('车型：小型普通客车');
            $table->string('model')->nullable()->comment('车辆标题:大众汽车牌SVW6666DFD');
            $table->string('register_date')->nullable()->comment('注册时间');
            $table->string('issue_date')->nullable()->comment('注册时间');
            $table->string('use_character')->nullable()->comment('用途:非营运');
            $table->timestamp('vci_end')->nullable()->comment('商业险结束时间');
            $table->timestamp('tci_end')->nullable()->comment('交强险结束时间');
            $table->timestamp('mots_end')->nullable()->comment('年检结束时间');
            $table->float('mileage',10,2)->default(0.00)->comment('公里数');
            $table->tinyInteger('use_status')->default(1)->comment('使用状态');
            $table->string('name')->nullable()->comment('车名称');
            $table->string('category')->nullable()->comment('车系');
            $table->string('data')->nullable()->comment('车参数：如变速箱');
            $table->string('label')->nullable()->comment('车标签');
            $table->text('pic')->nullable()->comment('车图片');
            $table->integer('lease_times')->default(0)->comment('租车次数');
            $table->string('descript')->nullable()->comment('简介');
            $table->integer('stock')->default(1)->comment('库存数量');
            $table->tinyInteger('status')->default(1)->comment('车辆状态 -1：下架，0：已经售罄 1：上架 ');
            $table->longText('drink')->nullable()->comment('随车饮料');
            $table->longText('non_lease_date')->nullable()->comment('不可租日期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recognize_driving_licenses');
    }
}
